uniform sampler2D data;
uniform float delta;

void main()
{
   vec2 currentCoord = vec2(gl_TexCoord[0].xy);

   vec4 value0 = texture2D(data, currentCoord);
   
   currentCoord.x = currentCoord.x + delta;
   vec4 value1 = texture2D(data, currentCoord);
   
   currentCoord.x = currentCoord.x - 2*delta;
   vec4 value2 = texture2D(data, currentCoord);
   
   currentCoord.x = currentCoord.x + delta;
   currentCoord.y = currentCoord.y + delta;
   vec4 value3 = texture2D(data, currentCoord);
   
   currentCoord.y = currentCoord.y - 2*delta;
   vec4 value4 = texture2D(data, currentCoord);
   
   currentCoord.y = currentCoord.y + 2*delta;
   currentCoord.x = currentCoord.x + delta;
   vec4 value5 = texture2D(data, currentCoord);
   
   currentCoord.y -= 2*delta;
   vec4 value6 = texture2D(data, currentCoord);
   
   currentCoord.x -= 2*delta;
   vec4 value7 = texture2D(data, currentCoord);
   
   currentCoord.y += 2*delta;
   vec4 value8 = texture2D(data, currentCoord);
   
   //change coefficients for different kernels
   vec4 finalValue = (1.0/9.0)*value0 + (1.0/9.0)*value1 + (1.0/9.0)*value2 +
       (1.0/9.0)*value3 + (1.0/9.0)*value4 + (1.0/9.0)*value5 +
       (1.0/9.0)*value6 + (1.0/9.0)*value7 + (1.0/9.0)*value8;
       
   gl_FragColor = finalValue;  
}